package ym.controller.front.website;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import ym.pojo.Announcement;
import ym.service.AnnouncementService;
import ym.vo.BaseResult;

import java.util.List;

/**
 * 公告
 */
@RestController
@CrossOrigin
@RequestMapping("/front/announcement")
public class FrontAnnouncementCon {
    @Autowired
    private AnnouncementService announcementService;

    /**
     * 查询所有
     *
     * @return
     */
    @GetMapping("/findAll")
    public BaseResult findAll() {
        List<Announcement> announcements = announcementService.findAll();
        return BaseResult.ok(announcements);
    }
}
